package exam04redpacket;

/*
抢红包也用到了多线程。
假设:100块，分成了3个包，现在有5个人去抢。
其中，红包是共享数据
5个人是5条线程。
打印结果如下
XXX抢到了XXX元
XXX抢到了XXX元
XXX抢到了XXX元
XXX没抢到
* */
public class ThreadDemo {
    public static void main(String[] args) {
        MyThread.num = 3;
        MyThread.money = 100;
        MyThread window1 = new MyThread("小明");
        MyThread window2 = new MyThread("小红");
        MyThread window3 = new MyThread("小黄");
        MyThread window4 = new MyThread("小绿");
        MyThread window5 = new MyThread("小白");

        window1.start();
        window2.start();
        window3.start();
        window4.start();
        window5.start();
    }



}
